package com.photo.utils;

import android.content.Context;

import com.idroid.utils.PxUtils;

/**
 * Created by bichuanfeng on 2016/8/15.
 */
public class MetricsUtil {

    public static int getHeightInPx(Context context) {
        final int height = context.getResources().getDisplayMetrics().heightPixels;
        return height;
    }

    public static int getWidthInPx(Context context) {
        final int width = context.getResources().getDisplayMetrics().widthPixels;
        return width;
    }
    public static int getHeightInDp(Context context) {
        final float height = context.getResources().getDisplayMetrics().heightPixels;
        int heightInDp = PxUtils.px2dip(context, height);
        return heightInDp;
    }

    public static int getWidthInDp(Context context) {
        final float width = context.getResources().getDisplayMetrics().widthPixels;
        int widthInDp = PxUtils.px2dip(context, width);
        return widthInDp;
    }
}
